import { RewardItem } from "./RewardItem";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { BaseItem } from "../../common/BaseItem";
import { SReward } from "../../../../../Message/Public/SReward";
import { ItemData } from "../../../resource/info/ItemData";
//class RewardGoods
    
    export  class RewardGoods extends RewardItem
    {
        constructor()
        {
            super();
            this._bg = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            addChild(this._bg);
            this._item = new BaseItem();
            this._item.setSize(32, 32);
            this._item.x = 3;
            this._item.y = 3;
            addChild(this._item);
            return;
        }

        public /* override */ flyItemTo(): void
        {
            if (this._itemData && this._item) 
            {
                var loc1=this._itemData.category;
            }
            return;
        }

        public /* override */ updateData(arg1: SReward): void
        {
            this._itemData = new ItemData(arg1.code);
            this._item.source = this._itemData.itemInfo.url;
            this._item.amount = arg1.num;
            this._item.toolTipData = this._itemData.getToolTipData();
            return;
        }

        public /* override */ dispose(arg1: Boolean=true): void
        {
            this._item.source = null;
            this._item.amount = 0;
            this._item.toolTipData = null;
            return;
        }

        public /* override */ get height(): number
        {
            return this._bg.height + 10;
        }

        public /* override */ get width(): number
        {
            return this._bg.width + 5;
        }

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_item: BaseItem;

        /* internal */ /* var */_itemData: ItemData;
    }
